<?php
header("Cache-Control:public");
header("Pragma:public");
header( "Content-Type: application/vnd.ms-excel; name='excel'" );//表示输出的类型为excel文件类型
header( "Content-type: application/octet-stream" );//表示二进制数据流，常用于文件下载

header( "Content-Disposition: attachment; filename=user.xls");//弹框下载文件
//以下三行代码使浏览器每次打开这个页面的时候不会使用缓存从而下载上一个文件
header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header( "Pragma: no-cache" );
header( "Expires: 0" );
?>
    <!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        .imcome-total {
            text-align: center;
            padding: 0 20px;
        }

        .imcome-total h1 {
            font-size: 30px;
            letter-spacing: 5px;
        }

        .imcome-total h3 {
            text-align: right;
            font-weight: 500;
            color: #666;
        }

        .imcome-total form {
            display: block;
            width: 100%;
        }

        .base-total {
            font-size: 12px;
            text-align: center;
            margin: 15px;
        }

        .base-total table {
            background: #f6f6f6;
            line-height: 35px;
            width: 100%;
            border-color: #ccc;
            border-collapse: collapse;
        }

        .base-total table th {
            text-align: center;
        }

        .base-total table input {
            background: transparent;
            text-align: center;
            border: 0;
            width: 100%;;
        }

        /*滚动条的宽度*/

        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }

        /*外层轨道。可以用display:none让其不显示，也可以添加背景图片，颜色改变显示效果*/

        ::-webkit-scrollbar-track {
            width: 6px;
            background-color: transparent;
            -webkit-border-radius: 2em;
            -moz-border-radius: 2em;
            border-radius: 2em;
        }

        /*滚动条的设置*/

        ::-webkit-scrollbar-thumb {
            background-color: #606d71;
            background-clip: padding-box;
            min-height: 28px;
            -webkit-border-radius: 2em;
            -moz-border-radius: 2em;
            border-radius: 2em;
        }

    </style>
</head>
<body>
<div class="imcome-total" style="padding-top: 15px">
    <div class="base-total">
        <table border="1">
            <thead>
            <tr>
                <th>姓名</th>
                <th>健身記錄(分)</th>
                <th>用戶編號</th>
                <th>用戶等级</th>
                <th>手機號</th>
                <th>積分</th>
                <th>積分过期时间</th>
            </tr>
            </thead>
            <tbody>

            @foreach ($result as $k=>$v)
                <tr>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->name}}</td>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->total_train_time}}</td>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->user_number}}</td>
                    <td style="vnd.ms-excel.numberformat:@">
                        @foreach($headhunting_commission_level as $vv)
                            @if($vv->id == $v->user_rank_id)                                  {{$vv->rank_name}}
                            @endif&nbsp;
                        @endforeach
                    </td>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->phone}}</td>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->total_integral??''}}</td>
                    <td style="vnd.ms-excel.numberformat:@">{{$v->expire_time??''}}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
